<?php 

  require_once('db.php');
  require_once('friends.php');
  $stats = global_stats();
  
?>
<html>
<body>

  <table>
    <tr>
      <th> laiks </th>
      <th> darbība </th>
      <th> kurš </th>
      <th> kuru </th>
    </tr>
    <?php foreach($stats as $row): ?>
    <tr>
      <td> <?= $row['time'] ?> </td>
      <td> <?= $row['action'] ?> </td>
      <td> <?= $row['friender_nick'] ?> </td>
      <td> <?= $row['friendee_nick'] ?> </td>
    </tr>
    <?php endforeach; ?>
  </table>

</body>
</html>
